<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Программа имитации и передачи сигнальной информации: Исходный файл /home/student/rostovcev_sergey/program/2024_winter/pk_irpsi_rrv/server/src/server.h</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Программа имитации и передачи сигнальной информации
   &#160;<span id="projectnumber">1</span>
   </div>
   <div id="projectbrief">Программный комплекс имитации регистрации и представления сигнальной информации в режиме реального времени</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Создано системой Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Поиск');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Поиск');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">server.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="server_8h.html">См. документацию.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="preprocessor">#ifndef SERVER_H</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="preprocessor">#define SERVER_H</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="preprocessor">#include &lt;QTcpServer&gt;</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="preprocessor">#include &lt;QTcpSocket&gt;</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="preprocessor">#include &lt;QVector&gt;</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="preprocessor">#include &lt;QDataStream&gt;</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="isi_8h.html">isi.h</a>&quot;</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="preprocessor">#include &lt;QTimer&gt;</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;</div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"><a class="line" href="class_server.html">   65</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_server.html">Server</a> : <span class="keyword">public</span> <a class="code" href="class_q_tcp_server.html">QTcpServer</a></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;{</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    Q_OBJECT</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="class_server.html#ad5ec9462b520e59f7ea831e157ee5e59">Server</a>();</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="struct_server_1_1_info_client.html">   75</a></span>&#160;     <span class="keyword">typedef</span> <span class="keyword">struct </span>{</div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="struct_server_1_1_info_client.html#a4587716f8df35e307c2954b5d97eef01">   76</a></span>&#160;        QTcpSocket *<a class="code" href="struct_server_1_1_info_client.html#a4587716f8df35e307c2954b5d97eef01">socket</a>;                 </div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="struct_server_1_1_info_client.html#ad9e8106a07dad8929318cacc05378624">   77</a></span>&#160;        <a class="code" href="class_isi.html">Isi</a>* <a class="code" href="struct_server_1_1_info_client.html#ad9e8106a07dad8929318cacc05378624">isi</a>;                           </div><div class="line"><a name="l00078"></a><span class="lineno"><a class="line" href="struct_server_1_1_info_client.html#aa60eb4d26d589e0ee9c62e75f5b41eee">   78</a></span>&#160;        quint16 hZ = 10;                    </div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="struct_server_1_1_info_client.html#a3a929bbcf9b0c109cb11c5651313e40b">   79</a></span>&#160;        <span class="keywordtype">int</span> rowSend = -1;                   </div><div class="line"><a name="l00080"></a><span class="lineno"><a class="line" href="struct_server_1_1_info_client.html#ab3de4cf4d7bcc5ab0e62da2389232bdf">   80</a></span>&#160;        <span class="keywordtype">int</span> <a class="code" href="struct_server_1_1_info_client.html#ab3de4cf4d7bcc5ab0e62da2389232bdf">timerId</a>;                        </div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    }<a class="code" href="struct_server_1_1_info_client.html">InfoClient</a>;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_server.html#a5c5b78878b825c89570a91585698d2c9">sendToClientTypeData</a>(<a class="code" href="struct_server_1_1_info_client.html">InfoClient</a> &amp;client);</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    QString <a class="code" href="class_server.html#a85382416b24d7748e9918c9b61c891fb">getMessage</a>(<span class="keywordtype">int</span> &amp;row, <a class="code" href="class_isi.html">Isi</a> *isi, <a class="code" href="struct_server_1_1_info_client.html">InfoClient</a> &amp;client);</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_server.html#a5d2d07e0075c92522bdb54aa3f236d7c">shetchik</a>(<span class="keywordtype">int</span> zero = 1);</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_server.html#ac8acf10d17b555315055459c14531fa2">sendToClientTypeFile</a>(<a class="code" href="struct_server_1_1_info_client.html">InfoClient</a> &amp;client);</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_server.html#adad89eda78d4e6807ba1fa00aa11eea1">sendToClientTypeHeader</a>(<a class="code" href="struct_server_1_1_info_client.html">InfoClient</a> &amp;client);</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;    <span class="keywordtype">bool</span> <a class="code" href="class_server.html#a7fecff50b32f71b369d2c5e92db53e40">sendToClientInfMsg</a>(<a class="code" href="struct_server_1_1_info_client.html">InfoClient</a> &amp;client);</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;<span class="keyword">public</span> slots:</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_server.html#a3952d37b7bc53a4377f411d9ccaa9d62">incomingConnection</a>(qintptr socketDescriptor);</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_server.html#ad7f0bc4f93fa08a16565f7f22cc562c5">slotReadyRead</a>();</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_server.html#aafcacc9ceba116f0230ef9dae9471adf">slotDeleteSocket</a>();</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="class_server.html#a42af2ee2f5253a4297aa1d7c3b6da510">setPath</a>(<span class="keywordtype">int</span> num_client, <a class="code" href="struct_server_1_1_info_client.html">InfoClient</a> &amp;isiRead);</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_server.html#a2a7975b6e5954fd0b806cd0ad4d155b1">timerEvent</a>( QTimerEvent * );</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="class_server.html#a92ccc20a12e7792f2ea57b47e607e438">  150</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="class_server.html#a92ccc20a12e7792f2ea57b47e607e438">d_numClients</a>;</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;</div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="class_server.html#a81cd9f8f6c9ec767add65e8524bda43a">  155</a></span>&#160;    QVector&lt;InfoClient&gt; <a class="code" href="class_server.html#a81cd9f8f6c9ec767add65e8524bda43a">d_clients</a>;</div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="class_server.html#a00fe7a0a159b812077eeed338a283c89">  159</a></span>&#160;    QVector &lt;QTcpSocket*&gt; <a class="code" href="class_server.html#a00fe7a0a159b812077eeed338a283c89">d_sockets</a>;</div><div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="class_server.html#a5c662ebed123578c0f24d034ac89d357">  163</a></span>&#160;    quint16 <a class="code" href="class_server.html#a5c662ebed123578c0f24d034ac89d357">d_nextBlockSize</a>;</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;};</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="preprocessor">#endif // SERVER_H</span></div><div class="ttc" id="class_server_html_a92ccc20a12e7792f2ea57b47e607e438"><div class="ttname"><a href="class_server.html#a92ccc20a12e7792f2ea57b47e607e438">Server::d_numClients</a></div><div class="ttdeci">int d_numClients</div><div class="ttdoc">d_numClients количество клиентов </div><div class="ttdef"><b>Definition:</b> server.h:150</div></div>
<div class="ttc" id="class_server_html"><div class="ttname"><a href="class_server.html">Server</a></div><div class="ttdoc">The Server class класс сервера </div><div class="ttdef"><b>Definition:</b> server.h:65</div></div>
<div class="ttc" id="class_server_html_ac8acf10d17b555315055459c14531fa2"><div class="ttname"><a href="class_server.html#ac8acf10d17b555315055459c14531fa2">Server::sendToClientTypeFile</a></div><div class="ttdeci">bool sendToClientTypeFile(InfoClient &amp;client)</div><div class="ttdoc">sendToClientTypeFile передать клиенту данные с типом файла </div><div class="ttdef"><b>Definition:</b> server.cpp:184</div></div>
<div class="ttc" id="class_server_html_adad89eda78d4e6807ba1fa00aa11eea1"><div class="ttname"><a href="class_server.html#adad89eda78d4e6807ba1fa00aa11eea1">Server::sendToClientTypeHeader</a></div><div class="ttdeci">bool sendToClientTypeHeader(InfoClient &amp;client)</div><div class="ttdoc">sendToClientTypeHeader передать клиенту данные из header </div><div class="ttdef"><b>Definition:</b> server.cpp:213</div></div>
<div class="ttc" id="class_server_html_a2a7975b6e5954fd0b806cd0ad4d155b1"><div class="ttname"><a href="class_server.html#a2a7975b6e5954fd0b806cd0ad4d155b1">Server::timerEvent</a></div><div class="ttdeci">virtual void timerEvent(QTimerEvent *)</div><div class="ttdoc">timerEvent событие связанные с таймером </div><div class="ttdef"><b>Definition:</b> server.cpp:164</div></div>
<div class="ttc" id="class_server_html_a81cd9f8f6c9ec767add65e8524bda43a"><div class="ttname"><a href="class_server.html#a81cd9f8f6c9ec767add65e8524bda43a">Server::d_clients</a></div><div class="ttdeci">QVector&lt; InfoClient &gt; d_clients</div><div class="ttdoc">d_clients вектор из структур с данными о клиентах </div><div class="ttdef"><b>Definition:</b> server.h:155</div></div>
<div class="ttc" id="struct_server_1_1_info_client_html_ab3de4cf4d7bcc5ab0e62da2389232bdf"><div class="ttname"><a href="struct_server_1_1_info_client.html#ab3de4cf4d7bcc5ab0e62da2389232bdf">Server::InfoClient::timerId</a></div><div class="ttdeci">int timerId</div><div class="ttdoc">таймер для передачи сообщения </div><div class="ttdef"><b>Definition:</b> server.h:80</div></div>
<div class="ttc" id="class_server_html_aafcacc9ceba116f0230ef9dae9471adf"><div class="ttname"><a href="class_server.html#aafcacc9ceba116f0230ef9dae9471adf">Server::slotDeleteSocket</a></div><div class="ttdeci">void slotDeleteSocket()</div><div class="ttdoc">slotDeleteSocket слот для удаления сокета из вектора </div><div class="ttdef"><b>Definition:</b> server.cpp:82</div></div>
<div class="ttc" id="class_server_html_a7fecff50b32f71b369d2c5e92db53e40"><div class="ttname"><a href="class_server.html#a7fecff50b32f71b369d2c5e92db53e40">Server::sendToClientInfMsg</a></div><div class="ttdeci">bool sendToClientInfMsg(InfoClient &amp;client)</div><div class="ttdoc">sendToClientInfMsg передать клиенту информационное сообщение </div><div class="ttdef"><b>Definition:</b> server.cpp:245</div></div>
<div class="ttc" id="struct_server_1_1_info_client_html_ad9e8106a07dad8929318cacc05378624"><div class="ttname"><a href="struct_server_1_1_info_client.html#ad9e8106a07dad8929318cacc05378624">Server::InfoClient::isi</a></div><div class="ttdeci">Isi * isi</div><div class="ttdoc">файл *.isi. </div><div class="ttdef"><b>Definition:</b> server.h:77</div></div>
<div class="ttc" id="class_server_html_a5c5b78878b825c89570a91585698d2c9"><div class="ttname"><a href="class_server.html#a5c5b78878b825c89570a91585698d2c9">Server::sendToClientTypeData</a></div><div class="ttdeci">bool sendToClientTypeData(InfoClient &amp;client)</div><div class="ttdoc">sendToClient передать данные клиенту </div><div class="ttdef"><b>Definition:</b> server.cpp:95</div></div>
<div class="ttc" id="class_server_html_a00fe7a0a159b812077eeed338a283c89"><div class="ttname"><a href="class_server.html#a00fe7a0a159b812077eeed338a283c89">Server::d_sockets</a></div><div class="ttdeci">QVector&lt; QTcpSocket * &gt; d_sockets</div><div class="ttdoc">d_sockets вектор сокетов подключенных клиентов </div><div class="ttdef"><b>Definition:</b> server.h:159</div></div>
<div class="ttc" id="class_q_tcp_server_html"><div class="ttname"><a href="class_q_tcp_server.html">QTcpServer</a></div></div>
<div class="ttc" id="class_isi_html"><div class="ttname"><a href="class_isi.html">Isi</a></div><div class="ttdoc">The Isi class Основной класс для получения информации из файла *.isi. </div><div class="ttdef"><b>Definition:</b> isi.h:14</div></div>
<div class="ttc" id="isi_8h_html"><div class="ttname"><a href="isi_8h.html">isi.h</a></div></div>
<div class="ttc" id="class_server_html_ad7f0bc4f93fa08a16565f7f22cc562c5"><div class="ttname"><a href="class_server.html#ad7f0bc4f93fa08a16565f7f22cc562c5">Server::slotReadyRead</a></div><div class="ttdeci">void slotReadyRead()</div><div class="ttdoc">slotReadyRead слот обработки целостности полученных данных </div><div class="ttdef"><b>Definition:</b> server.cpp:58</div></div>
<div class="ttc" id="struct_server_1_1_info_client_html"><div class="ttname"><a href="struct_server_1_1_info_client.html">Server::InfoClient</a></div><div class="ttdoc">The infoClient struct структура сведения о клиенте </div><div class="ttdef"><b>Definition:</b> server.h:75</div></div>
<div class="ttc" id="class_server_html_a3952d37b7bc53a4377f411d9ccaa9d62"><div class="ttname"><a href="class_server.html#a3952d37b7bc53a4377f411d9ccaa9d62">Server::incomingConnection</a></div><div class="ttdeci">void incomingConnection(qintptr socketDescriptor)</div><div class="ttdoc">incomingConnection слот обработки нового подключения </div><div class="ttdef"><b>Definition:</b> server.cpp:20</div></div>
<div class="ttc" id="class_server_html_a42af2ee2f5253a4297aa1d7c3b6da510"><div class="ttname"><a href="class_server.html#a42af2ee2f5253a4297aa1d7c3b6da510">Server::setPath</a></div><div class="ttdeci">void setPath(int num_client, InfoClient &amp;isiRead)</div><div class="ttdoc">setPath назначить клиету файл с данными для передачи </div><div class="ttdef"><b>Definition:</b> server.cpp:257</div></div>
<div class="ttc" id="class_server_html_a85382416b24d7748e9918c9b61c891fb"><div class="ttname"><a href="class_server.html#a85382416b24d7748e9918c9b61c891fb">Server::getMessage</a></div><div class="ttdeci">QString getMessage(int &amp;row, Isi *isi, InfoClient &amp;client)</div><div class="ttdoc">getMessage получить и сформировать сообщение из данных isi </div><div class="ttdef"><b>Definition:</b> server.cpp:139</div></div>
<div class="ttc" id="class_server_html_ad5ec9462b520e59f7ea831e157ee5e59"><div class="ttname"><a href="class_server.html#ad5ec9462b520e59f7ea831e157ee5e59">Server::Server</a></div><div class="ttdeci">Server()</div><div class="ttdef"><b>Definition:</b> server.cpp:5</div></div>
<div class="ttc" id="class_server_html_a5d2d07e0075c92522bdb54aa3f236d7c"><div class="ttname"><a href="class_server.html#a5d2d07e0075c92522bdb54aa3f236d7c">Server::shetchik</a></div><div class="ttdeci">int shetchik(int zero=1)</div><div class="ttdoc">shetchik счётчик для повторной отправки сообщения </div><div class="ttdef"><b>Definition:</b> server.cpp:127</div></div>
<div class="ttc" id="class_server_html_a5c662ebed123578c0f24d034ac89d357"><div class="ttname"><a href="class_server.html#a5c662ebed123578c0f24d034ac89d357">Server::d_nextBlockSize</a></div><div class="ttdeci">quint16 d_nextBlockSize</div><div class="ttdoc">d_nextBlockSize размер следующего блока </div><div class="ttdef"><b>Definition:</b> server.h:163</div></div>
<div class="ttc" id="struct_server_1_1_info_client_html_a4587716f8df35e307c2954b5d97eef01"><div class="ttname"><a href="struct_server_1_1_info_client.html#a4587716f8df35e307c2954b5d97eef01">Server::InfoClient::socket</a></div><div class="ttdeci">QTcpSocket * socket</div><div class="ttdoc">сокет клиента </div><div class="ttdef"><b>Definition:</b> server.h:76</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Создано системой &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
